import { createRouter, createWebHashHistory } from 'vue-router'
import Recommend from '@/views/recommend'
import Home from '@/views/home'
const Album = () => import('@/views/recommend/album')
const Singer = () => import('@/views/singer')
const SingerList = () => import('@/views/singer/list')
const SingerDetail = () => import('@/views/singer/detail')
const List = () => import('@/views/list')
const ListDetail = () => import('@/views/list/detail')
const Search = () => import('@/views/search')
const User = () => import('@/views/user')
// import Album from '@/views/recommend/album'
// import Singer from '@/views/singer'
// import SingerList from '@/views/singer/list'
// import SingerDetail from '@/views/singer/detail'
// import List from '@/views/list'
// import ListDetail from '@/views/list/detail'
// import Search from '@/views/search'
// import User from '@/views/user'

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    redirect: '/recommend',
    component: Home,
    children: [
      {
        path: '/recommend',
        name: 'recommend',
        component: Recommend,
        children: []
      },
      {
        path: '/singer',
        name: 'singer',
        component: Singer,
        redirect: '/singerlist',
        children: [
          {
            path: '/singerlist',
            name: 'singlist',
            component: SingerList
          }
        ]
      },
      {
        path: '/list',
        name: 'list',
        component: List
      },
      {
        path: '/search',
        name: 'search',
        component: Search,
        children: []
      }
    ]
  },
  {
    path: '/singer/detail',
    name: 'singerDetail',
    component: SingerDetail
  },
  {
    path: '/recommend/album',
    name: 'album',
    component: Album
  },
  {
    path: '/list/detail',
    name: 'listDetail',
    component: ListDetail
  },
  {
    path: '/user',
    name: 'user',
    component: User
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
